home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
pctj486.arc
/
MULDIV.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-09-07
|
943b
|
54 lines
program mul_div;
var
hour,min,sec,frac,nr,i : integer;
a,b,c : real;
procedure TIMER;
type
REGPACK = record
AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : integer
end;
var
regs: Regpack;
begin
with REGS do
begin
AX := $2C00;
MsDos(REGS);
HOUR := hi(CX);
MIN := lo(CX);
SEC := hi(DX);
FRAC := lo(DX);
end;
end;
begin
writeln('Ten thousand multiplications, ten thousand divisions');
writeln;
nr := 5000;
a := 2.71828;
b := 3.14159;
c := 1;
timer;
writeln('START: ',min,':',sec,'.',frac);
for i := 1 to nr do
begin
c := c*a;
c := c*b;
c := c/a;
c := c/b;
end;
timer;
writeln('END : ',min,':',sec,'.',frac);
writeln('Done.');
writeln('Error = ',c-1);
end.